<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /* 
            二叉树某个节点的最大深度为  Math.max(maxDepth(root.left),maxDepth(root.right))+1
            */
      var maxDepth = function (root) {
        if (!root) return 0
        return Math.max(maxDepth(root.left), maxDepth(root.right)) + 1
      }
    </script>
  </body>
</html>
